import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import('@/views/index'),
    meta: { title: '登录', icon: '' ,keepAlive: true},
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/home/home'),
    meta: { title: '主页', icon: '' ,keepAlive: true},
    children: [
      {
        path: '/home/userManagement',
        name: 'userManagement',
        component: () => import('@/views/userManagement/userManagement'),
        meta: { title: '机务用户管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/diningManagement',
        name: 'diningManagement',
        component: () => import('@/views/diningManagement/diningManagement'),
        meta: { title: '餐别管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/apatment',
        name: 'Apatment',
        component: () => import('@/views/apatment/apatment'),
        meta: { title: '公寓科管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/apatmentUserManagement',
        name: 'ApatmentUserManagement',
        component: () => import('@/views/apatmentUserManagement/apatmentUserManagement'),
        meta: { title: '公寓用户管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/apartmentDiningManagement',
        name: 'ApartmentDiningManagement',
        component: () => import('@/views/apartmentDiningManagement/apartmentDiningManagement'),
        meta: { title: '公寓餐别管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/departmentPermission',
        name: 'DepartmentPermission',
        component: () => import('@/views/departmentPermission/departmentPermission'),
        meta: { title: '机务权限管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/apartmentPermission',
        name: 'ApartmentPermission',
        component: () => import('@/views/apartmentPermission/apartmentPermission'),
        meta: { title: '公寓权限管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/informationManagement',
        name: 'InformationManagement',
        component: () => import('@/views/InformationManagement/InformationManagement'),
        meta: { title: '公告管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/discussManagement',
        name: 'DiscussManagement',
        component: () => import('@/views/discussManagement/discussManagement'),
        meta: { title: '评论管理', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/updateHomeImage',
        name: 'UpdateHomeImage',
        component: () => import('@/views/updateHomeImage/updateHomeImage'),
        meta: { title: '修改首页轮播图', icon: '' ,keepAlive: true}
      },
      {
        path: '/home/adminStatements',
        name: 'AdminStatements',
        component: () => import('@/views/adminStatements/adminStatements'),
        meta: { title: '财务报表', icon: '' ,keepAlive: true}
      }
    ]
  }
];

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
});

export default router
